﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;

namespace OpenAuth.App
{
    public class CYYGH010App : ApiBaseApp<CYYGH010>
    {
        public CYYGH010App(IApiRepository<CYYGH010> repository) : base(repository)
        {
        }
        /// <summary>
        /// 爽约信息查询(查询患者爽约信息)
        /// </summary>
        /// <param name="patid">患者唯一编码</param>
        /// <param name="ksrq">开始日期</param>
        /// <param name="jsrq">结束日期</param>
        /// <param name="hzxm">患者姓名</param>
        /// <param name="czybz">操作员标志</param>
        /// <returns></returns>
        public IEnumerable<CYYGH010> QueryCYYGH010ByPatid(string patid, string ksrq, string jsrq, string hzxm, string czybz)
        {
            List<SqlParameter> param = new List<SqlParameter>();
            param.Add(new SqlParameter("@Patid", patid));
            param.Add(new SqlParameter("@Ksrq", ksrq));
            param.Add(new SqlParameter("@Jsrq", jsrq));
            param.Add(new SqlParameter("@Czyh", "hf001"));
            param.Add(new SqlParameter("@Hzxm", hzxm));
            param.Add(new SqlParameter("@Czybz", czybz));
            var result = Query<CYYGH010>("exec usp_web_webtrans_CYYGH010 @patid=@Patid,@ksrq=@Ksrq,@jsrq=@Jsrq,@czyh=@Czyh,@hzxm=@Hzxm,@czybz=@Czybz", param);
            return result;
        }
    }
}
